#include "StdAfx.h"
#include "ZTmd5export.h"
#include "ZTmd5.h"
#include "ZCString.h"


CString ZTMD5::File(CString filename )
{
	ZNCharA tempstr(filename);
	///ZCString tempstr(filename);
	char * ddddd = tempstr.Buf();
	char * rettt = MD5File(ddddd);
	CString retstr(rettt);
	delete []ddddd;
	delete []rettt;
	return retstr;
}
CString  ZTMD5::buf( char *  bufdata ,int nLen)
{
	Init();
	Update((unsigned char*)bufdata, (unsigned int)nLen);
	Finalize();
	char * rettt  = PrintMD5(Digest());
	CString retstr(rettt);
	delete []rettt;
	return retstr;
}
CString ZTMD5::Str(CString  str )
{
	ZNCharA tempstr(str);
	///ZCString tempstr(filename);
	char * ddddd = tempstr.Buf();
	//ZCString tempstr(str);
	//char * ddddd = tempstr.GetChar();
	char * rettt  = MD5String(ddddd);
	CString retstr(rettt);
	delete []ddddd;
	delete []rettt;
	return retstr;
}